Socket
Socket
Sign inDemoInstall

json-schema-deref-sync

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-deref-sync

Simple Node.js JSON Schema dereferencer


Version published
Weekly downloads
675K
increased by5.08%
Maintainers
1
Weekly downloads
 
Created

What is json-schema-deref-sync?

The json-schema-deref-sync npm package is used to dereference JSON schemas. It resolves all $ref pointers in a JSON schema synchronously, making it easier to work with complex schemas that have multiple references.

What are json-schema-deref-sync's main functionalities?

Dereferencing JSON Schema

This feature allows you to dereference a JSON schema, resolving all $ref pointers. The code sample demonstrates how to use the json-schema-deref-sync package to dereference a schema with internal references.

const deref = require('json-schema-deref-sync');
const schema = {
  "$id": "http://example.com/root.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "address": {
      "type": "object",
      "properties": {
        "street_address": { "type": "string" },
        "city": { "type": "string" },
        "state": { "type": "string" }
      },
      "required": ["street_address", "city", "state"]
    }
  },
  "type": "object",
  "properties": {
    "billing_address": { "$ref": "#/definitions/address" },
    "shipping_address": { "$ref": "#/definitions/address" }
  }
};
const dereferencedSchema = deref(schema);
console.log(JSON.stringify(dereferencedSchema, null, 2));

Other packages similar to json-schema-deref-sync

Keywords

FAQs

Package last updated on 10 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc